package weiqian.hardware;

import java.io.FileDescriptor;

public class SerialPortJni {
    public native static FileDescriptor OpenSerialPort0(String path, int baud, int databits,  String parity, int stopbits);
    public native static void CloseSerialPort0(FileDescriptor fileDescriptor);
    public native static int OpenSerialPort1(String path, int baud, int databits, String parity, int stopbits);
    public native static void CloseSerialPort1(int fd);
    public native static int ReadSerialPort1(int fd, byte[] buff, int count, long timeout);
    public native static int WriteSerialPort1(int fd, byte[] buff, int count);
    static {
        System.loadLibrary("SerialPortJni");   //库在目标机器内
    }
}